{
 "metadata": {
  "signature": "sha256:6a0d87c0286ee4da39c6ff0e5eee67a824a84cefe7a7f6023b9ceef3114d20bb"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "code",
     "collapsed": false,
     "id": "4093099E7FFE4AE58E10F93618B12775",
     "input": [
      "DataAPI.MktEqudGet(tradeDate=u\"20150513\",secID=[\"000001.XSHE\",\"600000.XSHG\"],\n",
      "                   ticker=u\"\",field=u\"secID,secShortName,tradeDate,closePrice,marketValue\",pandas=\"1\")"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "html": [
        "<div style=\"max-width:1500px;overflow:auto;\">\n",
        "<table border=\"1\" class=\"dataframe\">\n",
        "  <thead>\n",
        "    <tr style=\"text-align: right;\">\n",
        "      <th></th>\n",
        "      <th>secID</th>\n",
        "      <th>secShortName</th>\n",
        "      <th>tradeDate</th>\n",
        "      <th>closePrice</th>\n",
        "      <th>marketValue</th>\n",
        "    </tr>\n",
        "  </thead>\n",
        "  <tbody>\n",
        "    <tr>\n",
        "      <th>0</th>\n",
        "      <td>000001.XSHE</td>\n",
        "      <td>\u5e73\u5b89\u94f6\u884c</td>\n",
        "      <td>2015-05-13</td>\n",
        "      <td>15.88</td>\n",
        "      <td>217712795944</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>1</th>\n",
        "      <td>600000.XSHG</td>\n",
        "      <td>\u6d66\u53d1\u94f6\u884c</td>\n",
        "      <td>2015-05-13</td>\n",
        "      <td>17.07</td>\n",
        "      <td>318414756798</td>\n",
        "    </tr>\n",
        "  </tbody>\n",
        "</table>\n",
        "</div>"
       ],
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 3,
       "text": [
        "         secID secShortName   tradeDate  closePrice   marketValue\n",
        "0  000001.XSHE         \u5e73\u5b89\u94f6\u884c  2015-05-13       15.88  217712795944\n",
        "1  600000.XSHG         \u6d66\u53d1\u94f6\u884c  2015-05-13       17.07  318414756798"
       ]
      }
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "id": "CF04373FB74B47828C1A1F6C21639854",
     "input": [
      "DataAPI.MktEqudGet(tradeDate=u\"\",secID=u\"\",ticker=[\"000001\",\"600000\"],\n",
      "                   beginDate='20180117',endDate='20180121',\n",
      "                   field=u\"secID,secShortName,tradeDate,closePrice,marketValue\",pandas=\"1\")"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "html": [
        "<div style=\"max-width:1500px;overflow:auto;\">\n",
        "<table border=\"1\" class=\"dataframe\">\n",
        "  <thead>\n",
        "    <tr style=\"text-align: right;\">\n",
        "      <th></th>\n",
        "      <th>secID</th>\n",
        "      <th>secShortName</th>\n",
        "      <th>tradeDate</th>\n",
        "      <th>closePrice</th>\n",
        "      <th>marketValue</th>\n",
        "    </tr>\n",
        "  </thead>\n",
        "  <tbody>\n",
        "    <tr>\n",
        "      <th>0</th>\n",
        "      <td>000001.XSHE</td>\n",
        "      <td>\u5e73\u5b89\u94f6\u884c</td>\n",
        "      <td>2018-01-17</td>\n",
        "      <td>14.23</td>\n",
        "      <td>244334954222</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>1</th>\n",
        "      <td>000001.XSHE</td>\n",
        "      <td>\u5e73\u5b89\u94f6\u884c</td>\n",
        "      <td>2018-01-18</td>\n",
        "      <td>14.72</td>\n",
        "      <td>252748455808</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>2</th>\n",
        "      <td>000001.XSHE</td>\n",
        "      <td>\u5e73\u5b89\u94f6\u884c</td>\n",
        "      <td>2018-01-19</td>\n",
        "      <td>14.80</td>\n",
        "      <td>254122088720</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>3</th>\n",
        "      <td>600000.XSHG</td>\n",
        "      <td>\u6d66\u53d1\u94f6\u884c</td>\n",
        "      <td>2018-01-17</td>\n",
        "      <td>13.10</td>\n",
        "      <td>384512253240</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>4</th>\n",
        "      <td>600000.XSHG</td>\n",
        "      <td>\u6d66\u53d1\u94f6\u884c</td>\n",
        "      <td>2018-01-18</td>\n",
        "      <td>13.24</td>\n",
        "      <td>388621544496</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>5</th>\n",
        "      <td>600000.XSHG</td>\n",
        "      <td>\u6d66\u53d1\u94f6\u884c</td>\n",
        "      <td>2018-01-19</td>\n",
        "      <td>13.24</td>\n",
        "      <td>388621544496</td>\n",
        "    </tr>\n",
        "  </tbody>\n",
        "</table>\n",
        "</div>"
       ],
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 7,
       "text": [
        "         secID secShortName   tradeDate  closePrice   marketValue\n",
        "0  000001.XSHE         \u5e73\u5b89\u94f6\u884c  2018-01-17       14.23  244334954222\n",
        "1  000001.XSHE         \u5e73\u5b89\u94f6\u884c  2018-01-18       14.72  252748455808\n",
        "2  000001.XSHE         \u5e73\u5b89\u94f6\u884c  2018-01-19       14.80  254122088720\n",
        "3  600000.XSHG         \u6d66\u53d1\u94f6\u884c  2018-01-17       13.10  384512253240\n",
        "4  600000.XSHG         \u6d66\u53d1\u94f6\u884c  2018-01-18       13.24  388621544496\n",
        "5  600000.XSHG         \u6d66\u53d1\u94f6\u884c  2018-01-19       13.24  388621544496"
       ]
      }
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "id": "72A21F5D497C468098FA3B0E74A5ABEE",
     "input": [
      "DataAPI.MktStockFactorsOneDayGet(tradeDate=u\"20150227\",secID=[\"000001.XSHE\",\"600000.XSHG\"],ticker=u\"\",\n",
      "                                 field=u\"secID,tradeDate,PS,PB,NetProfitGrowRate\",pandas=\"1\")"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "html": [
        "<div style=\"max-width:1500px;overflow:auto;\">\n",
        "<table border=\"1\" class=\"dataframe\">\n",
        "  <thead>\n",
        "    <tr style=\"text-align: right;\">\n",
        "      <th></th>\n",
        "      <th>secID</th>\n",
        "      <th>tradeDate</th>\n",
        "      <th>PS</th>\n",
        "      <th>PB</th>\n",
        "      <th>NetProfitGrowRate</th>\n",
        "    </tr>\n",
        "  </thead>\n",
        "  <tbody>\n",
        "    <tr>\n",
        "      <th>0</th>\n",
        "      <td>000001.XSHE</td>\n",
        "      <td>2015-02-27</td>\n",
        "      <td>2.2999</td>\n",
        "      <td>1.2612</td>\n",
        "      <td>0.2938</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>1</th>\n",
        "      <td>600000.XSHG</td>\n",
        "      <td>2015-02-27</td>\n",
        "      <td>2.3104</td>\n",
        "      <td>1.1716</td>\n",
        "      <td>0.2176</td>\n",
        "    </tr>\n",
        "  </tbody>\n",
        "</table>\n",
        "</div>"
       ],
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 9,
       "text": [
        "         secID   tradeDate      PS      PB  NetProfitGrowRate\n",
        "0  000001.XSHE  2015-02-27  2.2999  1.2612             0.2938\n",
        "1  600000.XSHG  2015-02-27  2.3104  1.1716             0.2176"
       ]
      }
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "id": "7F2DF9B32A714486B7ED0BEA8DFEA1D6",
     "input": [
      "import pandas as pd\n",
      "df = pd.DataFrame()\n",
      "for ticker in [\"600000\",'000001']:\n",
      "    tmp_df = DataAPI.MktStockFactorsDateRangeGet(secID=u\"\",ticker=ticker,beginDate=u\"20170612\",endDate=u\"20170616\",\n",
      "                                    field=u\"secID,tradeDate,PS,PB,NetProfitGrowRate\",pandas=\"1\")\n",
      "    df = pd.concat([df,tmp_df],axis=0)\n",
      "df.reset_index(drop=True)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "html": [
        "<div style=\"max-width:1500px;overflow:auto;\">\n",
        "<table border=\"1\" class=\"dataframe\">\n",
        "  <thead>\n",
        "    <tr style=\"text-align: right;\">\n",
        "      <th></th>\n",
        "      <th>secID</th>\n",
        "      <th>tradeDate</th>\n",
        "      <th>PS</th>\n",
        "      <th>PB</th>\n",
        "      <th>NetProfitGrowRate</th>\n",
        "    </tr>\n",
        "  </thead>\n",
        "  <tbody>\n",
        "    <tr>\n",
        "      <th>0</th>\n",
        "      <td>600000.XSHG</td>\n",
        "      <td>2017-06-12</td>\n",
        "      <td>2.2314</td>\n",
        "      <td>1.0258</td>\n",
        "      <td>0.0106</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>1</th>\n",
        "      <td>600000.XSHG</td>\n",
        "      <td>2017-06-13</td>\n",
        "      <td>2.1982</td>\n",
        "      <td>1.0105</td>\n",
        "      <td>0.0106</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>2</th>\n",
        "      <td>600000.XSHG</td>\n",
        "      <td>2017-06-14</td>\n",
        "      <td>2.1755</td>\n",
        "      <td>1.0001</td>\n",
        "      <td>0.0106</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>3</th>\n",
        "      <td>600000.XSHG</td>\n",
        "      <td>2017-06-15</td>\n",
        "      <td>2.1615</td>\n",
        "      <td>0.9937</td>\n",
        "      <td>0.0106</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>4</th>\n",
        "      <td>600000.XSHG</td>\n",
        "      <td>2017-06-16</td>\n",
        "      <td>2.1563</td>\n",
        "      <td>0.9913</td>\n",
        "      <td>0.0106</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>5</th>\n",
        "      <td>000001.XSHE</td>\n",
        "      <td>2017-06-12</td>\n",
        "      <td>1.4498</td>\n",
        "      <td>0.8330</td>\n",
        "      <td>0.0181</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>6</th>\n",
        "      <td>000001.XSHE</td>\n",
        "      <td>2017-06-13</td>\n",
        "      <td>1.4514</td>\n",
        "      <td>0.8339</td>\n",
        "      <td>0.0181</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>7</th>\n",
        "      <td>000001.XSHE</td>\n",
        "      <td>2017-06-14</td>\n",
        "      <td>1.4450</td>\n",
        "      <td>0.8302</td>\n",
        "      <td>0.0181</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>8</th>\n",
        "      <td>000001.XSHE</td>\n",
        "      <td>2017-06-15</td>\n",
        "      <td>1.4386</td>\n",
        "      <td>0.8266</td>\n",
        "      <td>0.0181</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>9</th>\n",
        "      <td>000001.XSHE</td>\n",
        "      <td>2017-06-16</td>\n",
        "      <td>1.4354</td>\n",
        "      <td>0.8248</td>\n",
        "      <td>0.0181</td>\n",
        "    </tr>\n",
        "  </tbody>\n",
        "</table>\n",
        "</div>"
       ],
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 13,
       "text": [
        "         secID   tradeDate      PS      PB  NetProfitGrowRate\n",
        "0  600000.XSHG  2017-06-12  2.2314  1.0258             0.0106\n",
        "1  600000.XSHG  2017-06-13  2.1982  1.0105             0.0106\n",
        "2  600000.XSHG  2017-06-14  2.1755  1.0001             0.0106\n",
        "3  600000.XSHG  2017-06-15  2.1615  0.9937             0.0106\n",
        "4  600000.XSHG  2017-06-16  2.1563  0.9913             0.0106\n",
        "5  000001.XSHE  2017-06-12  1.4498  0.8330             0.0181\n",
        "6  000001.XSHE  2017-06-13  1.4514  0.8339             0.0181\n",
        "7  000001.XSHE  2017-06-14  1.4450  0.8302             0.0181\n",
        "8  000001.XSHE  2017-06-15  1.4386  0.8266             0.0181\n",
        "9  000001.XSHE  2017-06-16  1.4354  0.8248             0.0181"
       ]
      }
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "id": "BBB5F3A9D5314752AD9647A8BDC908EE",
     "input": [],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "id": "A679C6FD11F849F184E474572E2D3FF6",
     "input": [],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "id": "D9974F04B147440DA3156A5B18C48633",
     "input": [],
     "language": "python",
     "metadata": {},
     "outputs": []
    }
   ],
   "metadata": {}
  }
 ]
}